package com.raycloud.listener;

import java.util.concurrent.ConcurrentLinkedQueue;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.raycloud.common.ScopeConstants;
import com.raycloud.domain.MsgDistributeJob;

public class BaseDataLoadListener implements ServletContextListener{

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		
	}

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		//加载消息队列，现在暂时是简单模型直接new一个
		ConcurrentLinkedQueue<MsgDistributeJob> jobQueue = new ConcurrentLinkedQueue<MsgDistributeJob>();
		sce.getServletContext().setAttribute(ScopeConstants.JOB_QUEUE, jobQueue);
		
	}

}
